package com.caiback.service.impl;

import com.caiback.mapper.UserMapper;
import com.caiback.pojo.User;
import com.caiback.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户服务实现类
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User login(User user) {
        return userMapper.getByUsernameAndPassword(user);
    }

    @Override
    public List<User> list() {
        return userMapper.list();
    }

    @Override
    public void edit(User user) {
        userMapper.editPost(user);
    }

    @Override
    public User introGet(Integer id) {
        return userMapper.getByUser(id);
    }
}
